package com.bocloud.cmp.driver.convertor.os;

import java.util.List;

import org.openstack4j.model.compute.Flavor;

import com.bocloud.cmp.driver.convertor.BeanConvert;
import com.bocloud.cmp.model.FlavorModel;
import com.google.common.collect.Lists;

public class ConvertFlavor implements BeanConvert<FlavorModel, Flavor> {

	@Override
	public List<FlavorModel> convertList(List<? extends Flavor> flavors) {
		List<FlavorModel> modes = Lists.newArrayList();
		for (Flavor flavor : flavors) {
			FlavorModel model = new FlavorModel();
			model.setCpu(flavor.getVcpus());
			model.setMemory(flavor.getRam());
			model.setName(flavor.getName());
			model.setFamily(null);
			model.setDisk(flavor.getDisk());
			model.setFlavorId(flavor.getId());
			modes.add(model);
		}
		return modes;
	}

	@Override
	public FlavorModel convertModel(Flavor model) {
		// TODO Auto-generated method stub
		return null;
	}

}
